This disclosure relates generally to program runtime in a data processing system and more specifically to identification of a root method associated with a thread in a data processing system.
Some types of programs drive the bulk of their respective execution tasks from a single root method or a small set of root methods, even perhaps different root methods on different threads. For example, a transaction processing application typically has a method in which incoming work is detected, examined, and dispatched accordingly to an appropriate handler. This type of root method can potentially optimize resources by providing better profiling but is difficult to find.
In order to find root methods, some techniques are being provided but none of them techniques work very well for identification purposes. One reason may be that root methods are not invoked too often and thus rarely reach the threshold required (or only reach that threshold after a relatively long time) to trigger identification. The other problem is that because root methods frequently do not consume significant processor resources (although tasks called from the root method do), they rarely accumulate very many samples to allow identification.
Speculation and guesses are utilized but they do not always provide correct predictions mainly because design patterns evolve and change over time. In addition, root methods can change over time requiring updates to an application to remain synchronized. Consequently, not all applications follow established design patterns and programmers may not know which method is the root method. In addition, the methodology often only works in applications modified to communicate root methods.